package com.caregiver.watch.business.notice.model.dto;

import com.caregiver.watch.business.notice.model.po.JPushUserBinding;
import com.caregiver.watch.common.exception.BaseException;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * @description: 绑定推送id参数
 * @program: caregiver-watch
 * @author: 疆戟
 * @create: 2025-10-05 14:51
 */
@Data
@Schema(description = "绑定推送id参数")
public class BindPushIdParam {

    /**
     * 极光推送注册ID
     */
    @Schema(description = "极光推送注册ID", required = true)
    private String registrationId;

    /**
     * 设备平台: ios, android, harmonyos等
     */
    @Schema(description = "设备平台: ios, android, harmonyos等")
    private String platform;

    /**
     * 设备型号
     */
    @Schema(description = "设备型号")
    private String deviceModel;

    /**
     * App版本号
     */
    @Schema(description = "App版本号")
    private String appVersion;


    public JPushUserBinding toPo(Long userId) {
        JPushUserBinding po = new JPushUserBinding();
        po.setUserId(userId);
        po.setRegistrationId(registrationId);
        po.setPlatform(platform);
        po.setDeviceModel(deviceModel);
        po.setAppVersion(appVersion);
        return po;
    }
}
